package com.dailyblue.java.standard.interview.offer2;

import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.List;
public class App {
    public static void main(String[] args) {
        List<Card> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            Card card = new Card();
            card.setId(i+1);
            int money = (int)(Math.random()*100+1);
            card.setMoney(money);
            list.add(card);
        }
        for(Card c:list){
            System.out.println(c);
        }
        System.out.println("-----------------------------------------");
        for (int i = 0; i < list.size()-1; i++) {
            for (int j = 0; j < list.size()-1-i; j++) {
                Card c1 = list.get(j);
                Card c2 = list.get(j+1);
                if(c1.compareTo(c2)>0){
                    Card c3 = c1;
                    list.set(j,c2);
                    list.set(j+1,c3);
                }
            }
        }

        for(Card c:list){
            System.out.println(c);
        }
    }
}
/*
    1.alter table acct_tran_hist drop column dr_cr_flag;
    2.alter table acct_tran_hist add coloum officer char(10);
    3.create index aaa on acct_tran_hist(account_no);
 */
